use crate::dto;
use serde::{Deserialize, Serialize};
use validator::Validate;
use wanmesh_common::validator::validate_string_is_not_empty;

pub type AddRequest = dto::core::traffic_steering_rule::AddParams;

#[derive(Serialize, Deserialize, Validate, Debug, Clone)]
pub struct GetRequest {
    #[validate(custom(function = "validate_string_is_not_empty"))]
    pub traffic_steering_rule_id: String,
}

#[derive(Serialize, Deserialize, Validate, Debug, Clone)]
pub struct UpdateRequest {
    #[validate(custom(function = "validate_string_is_not_empty"))]
    pub traffic_steering_rule_id: String,
    pub params: dto::core::traffic_steering_rule::UpdateParams,
}

#[derive(Serialize, Deserialize, Validate, Debug, Clone)]
pub struct DeleteRequest {
    #[validate(custom(function = "validate_string_is_not_empty"))]
    pub traffic_steering_rule_id: String,
}

pub type ListRequest = wanmesh_common::dto::ListRequest<dto::core::traffic_steering_rule::Filter>;
pub type ListResponseData = wanmesh_common::dto::ListResponseData<
    dto::core::traffic_steering_rule::TrafficSteeringRuleItem,
>;
pub type ListInfoResponseData = wanmesh_common::dto::ListResponseData<
    dto::core::traffic_steering_rule::TrafficSteeringRuleItem,
>;
